import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/home",
  },
  {
    path: "/login",
    name: "login",
    component: () => import("@/views/login/index"),
  },
  {
    path: "/register",
    name: "register",
    component: () => import("@/views/Register/index"),
  },
  {
    path: "/home",
    name: "home",
    component: () => import("@/views/Home/index"),
  },
  {
    path: "/exercise",
    name: "exercise",
    component: () => import("@/views/Exercise/index"),
  },
  {
    path: "/exam",
    name: "exam",
    component: () => import("@/views/Exam/index"),
  },
  {
    path: "/history",
    name: "history",
    component: () => import("@/views/History/index"),
  },
  {
    path: "/questions",
    name: "questions",
    component: () => import("@/views/Questions/index"),
  },
  {
    path: "/test",
    name: "test",
    component: () => import("@/views/Test/index"),
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
